package testCsvIO;


import junit.framework.*;

import org.junit.Test;
import org.junit.After;
import org.junit.Before;


import java.io.ByteArrayInputStream;
import java.io.InputStream;



import csvIO.CsvIO;


public class CsvIOTest extends TestCase 
{

	
	
private CsvIO csvIO;
	
	public CsvIOTest(String name)
	{
		super(name);
	}
	
	
	
	@Before
	public void setUp() throws Exception 
	{	
		csvIO = new CsvIO(); 
	}

	@After
	public void tearDown() throws Exception 
	{
		
	}
	
	@Test
	public void testGetSortedF5Namelist() 
	{
		String path="C:\\Users\\52410963\\Desktop\\SortedF5Namelist.csv";
		String expected[][]=new String[3][5];
		expected[0][0]="8016";
		expected[0][1]="5A";
		expected[0][2]="1";
		expected[0][3]="CHAN TSENG";
		expected[0][4]="M";
		expected[1][0]="8060";
		expected[1][1]="5B";
		expected[1][2]="26";
		expected[1][3]="HOU HEI TUNG";
		expected[1][4]="F";
		expected[2][0]="8193";
		expected[2][1]="5E";
		expected[2][2]="39";
		expected[2][3]="YU WAI YEE LORRAINE";
		expected[2][4]="F";
		
		assertEquals(csvIO.getStudentList(path), expected);
		
	}

}
